package com.yuanrui.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 *
 * @author: ChickenWing
 * @date: 2023/10/3
 */
@Getter
public enum SubjectLikedStatusEnum {

    /**
     * 点赞
     */
    LIKED(1, "点赞"),

    /**
     * 不点赞
     */
    UN_LIKED(0, "取消点赞");

    private final Integer code;
    private final String desc;

    SubjectLikedStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectLikedStatusEnum getByCode(Integer code) {
        for (SubjectLikedStatusEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }

}
